
export const PARAMS_MATERIAL = [
    {
        type: "input",
        field: "name",
        title: "材料名称",
        value: "",
        props: {placeholder:"请输入材料名称"}
    },
    {
        type: "input",
        field: "unit",
        title: "单位",
        value: "",
        props: {placeholder:"请输入单位"}
    },
    {
        type: "input",
        field: "spec",
        title: "规格型号",
        value: "",
        props: {placeholder:"请输入规格型号"}
    },
    {
        type: "select",
        field: "type1Id",
        title: "一级分类",
        value: "",
        options:[],
        props: {placeholder:"请选择一级分类"},
        emit: ['change'],
        emitPrefix: 'btn-type1',
    },
    {
        type: "select",
        field: "type2Id",
        title: "二级分类",
        value: "",
        options:[],
        props: {placeholder:"请选择二级分类"},
        emit: ['change'],
        emitPrefix: 'btn-type2',
    },
    {
        type: "select",
        field: "type3Id",
        title: "三级分类",
        value: "",
        options:[],
        props: {placeholder:"请选择三级分类"}
    },
    {
      type:'el-button',
      field:'search',
      props:{
          type:'primary',
          icon:"el-icon-search"
      },
      children:['搜索'],
      emit: ['click'],
      emitPrefix: 'btn-search',
    },
    {
      type:'el-button',
      field:'reset',
      props:{
          type:'primary',
          icon:"el-icon-setting"
      },
      children:['重置'],
      emit: ['click'],
      emitPrefix: 'btn-reset',
    },
    {
      type:'el-button',
      field:'add',
      props:{
          type:'danger',
          icon:"el-icon-plus"
      },
      children:['新增'],
      emit: ['click'],
      emitPrefix: 'btn-add',
    },
    {
      type:'el-button',
      field:'upload',
      props:{
          type:'danger',
          icon:"el-icon-upload"
      },
      children:['导出物资'],
      emit: ['click'],
      emitPrefix: 'btn-upload',
    },
    {
      type:'el-button',
      field:'del',
      props:{
          type:'danger',
          icon:"el-icon-delete"
      },
      children:['批量删除'],
      emit: ['click'],
      emitPrefix: 'btn-del',
    }
  ]
  
  export let FORM_MATERIAL = [
    {
      type: "input",
      field: "name",
      title: "材料名称",
      value: "",
      col: { span: 8 },
      props: { type: "text"},
      validate: [
        { required: true, message: "请输入材料名称", trigger: "blur" }
      ]
    },
    {
      type: "input",
      field: "spec",
      title: "规格型号",
      value: "",
      col: { span: 8 },
      props: { type: "text"},
      validate: [
        { required: true, message: "请输入规格型号", trigger: "blur" }
      ]
    },
    {
        type: "input",
        field: "unit",
        title: "单位",
        value: "",
        col: { span: 8 },
        props: { type: "text" },
        validate: [
          { required: true, message: "请输入单位", trigger: "blur" }
        ]
      },
     /*  {
        type: "input",
        field: "stockNum",
        title: "库存",
        value: "",
        col: { span: 8 },
        props: { type: "text"},
        validate: [
          { required: true, message: "请输入库存", trigger: "blur" }
        ]
      }, */
      {
        type: "input",
        field: "price",
        title: "单价/元",
        value: "",
        col: { span: 8 },
        props: { type: "text",maxlength:8,placeholder:"限制8位数"},
        validate: [
          { required: true, message: "请输入单价/元", trigger: "blur" },
          {
            validator: (rule, val, d) => {
              const reg = /^(?!0+(?:\.0+)?$)(?:[1-9]\d*|0)(?:\.\d{1,2})?$/
              val && !reg.test(val) ? d(true) : d()
            },message: '单价为正整数或者最多保留两位小数'
          }
        ]
      },
      /* {
        type: "input",
        field: "contactPhone",
        title: "联系方式",
        value: "",
        col: { span: 8 },
        props: { type: "text",maxlength:11},
        validate: [
          { required: true, message: "请输入联系方式", trigger: "blur" },
          {
            validator: (rule, val, d) => {
              val && !/^1(3[0-9]|4[5,7]|5[0,1,2,3,5,6,7,8,9]|6[2,5,6,7]|7[0,1,7,8]|8[0-9]|9[1,8,9])\d{8}$/.test(val) ? d(true) : d();
            },
            message: "手机格式错误"
          }
        ]
      }, */
    {
      type: "select",
      field: "goodTypeId1",
      title: "一级分类",
      value: "",
      options:[],
      col: { span: 8 },
      props: { style:"width:100%"},
      validate: [
        { required: true, message: "请选择一级分类", trigger: "change" }
      ],
      emit: ['change'],
        emitPrefix: 'btn-type1',
      },
    {
        type: "select",
        field: "goodTypeId2",
        title: "二级分类",
        value: "",
        options:[],
        col: { span: 8 },
        props: { style:"width:100%"},
        validate: [
          { required: true, message: "请选择二级分类", trigger: "change" }
        ],
        emit: ['change'],
        emitPrefix: 'btn-type2',
    },
    {
        type: "select",
        field: "goodTypeId3",
        title: "三级分类",
        value: "",
        options:[],
        col: { span: 8 },
        props: { style:"width:100%"},
        validate: [
          { required: true, message: "请选择三级分类", trigger: "change" }
        ]
    },
    {
      type: "input",
      field: "code",
      title: "物资编码",
      value: "",
      col: { span: 8 },
      props: { type: "text"},
      validate: [
        { required: true, message: "请输入物资编码", trigger: "blur" }
      ]
    },
    /* {
      type: "input",
      field: "companyName",
      title: "公司名称",
      value: "",
      col: { span: 8 },
      props: { type: "text"},
      validate: [
        { required: true, message: "请输入公司名称", trigger: "blur" }
      ]
    },
    {
      type: "input",
      field: "companyAddress",
      title: "公司地址",
      value: "",
      col: { span: 8 },
      props: { type: "text"},
      validate: [
        { required: true, message: "请输入公司地址", trigger: "blur" }
      ]
    },
    {
      type:"input",
      field:"mainBusiness",
      title:"主营业务",
      value: "",
      col: { span: 24 },
      props: { type: "textarea" },
      validate: [
        { required: true, message: "请输入主营业务", trigger: "blur" }
      ]
    }, */
    {
      type: "input",
      field: "remarks",
      title: "备注",
      value: "",
      col: { span: 24 },
      props: { type: "textarea"}
    }
  ]


export const MATERIAL_LABEL = [
  { label: "创建时间", prop: "createTime",width:"160",type:'createTime'},
  { label: "", prop: "",width:"40",type:'checkbox'},
  { label: "材料名称", prop: "name",width:"160",type:'normal'},
  { label: "材料编码", prop: "code",width:"160",type:'normal'},
  { label: "规格型号", prop: "spec",width:"100",type:'normal'},
  { label: "单位", prop: "unit",width:"180",type:'normal' },
 /*  { label: "库存", prop: "stockNum",width:"80",type:'normal'}, */
  { label: "一级分类", prop:'type1Name',width:"120",type:'normal'},
  { label: "二级分类", prop:'type2Name',width:"120",type:'normal'},
  { label: "三级分类", prop:'type3Name',width:"120",type:'normal'},
  { label: "单件/元", prop: "price",width:"80",type:'normal'},
 /*  { label: "联系方式", prop: "contactPhone",width:"150",type:'normal'},
  { label: "公司名称", prop: "companyName",width:"200",type:'normal'},
  { label: "公司地址", prop: "companyAddress",width:"200",type:'normal'},
  { label: "主营业务", prop: "mainBusiness",width:"200",type:'normal'}, */
  { label: "备注", prop:'remarks',width:"200",type:'normal'},
  { label: "创建人", prop: "createUserName",width:"120",type:'normal'},
  { label: "更新时间", prop: "updateTime",width:"160",type:'updateTime'}
]

export const MATERIAL_TAB = [
  {label:"分类1",value:"1"},
  {label:"分类2",value:"2"},
  {label:"分类3",value:"3"}
]

  
export const PARAMS_MATERIAL_CLASSIFY = [
    {
        type: "select",
        field: "type1Id",
        title: "一级分类",
        value: "",
        options:[],
        props: {placeholder:"请选择一级分类"},
        emit: ['change'],
        emitPrefix: 'btn-type1'

    },
    {
        type: "select",
        field: "type2Id",
        title: "二级分类",
        value: "",
        options:[],
        props: {placeholder:"请选择二级分类"},
        emit: ['change'],
        emitPrefix: 'btn-type2',

    },
    {
        type: "select",
        field: "type3Id",
        title: "三级分类",
        value: "",
        options:[],
        props: {placeholder:"请选择三级分类"}
    },
    {
      type:'el-button',
      field:'search',
      props:{
          type:'primary',
          icon:"el-icon-search"
      },
      children:['搜索'],
      emit: ['click'],
      emitPrefix: 'btn-search',
    },
    {
      type:'el-button',
      field:'reset',
      props:{
          type:'primary',
          icon:"el-icon-reset"
      },
      children:['重置'],
      emit: ['click'],
      emitPrefix: 'btn-reset',
    },
    {
      type:'el-button',
      field:'add',
      props:{
          type:'danger',
          icon:"el-icon-plus",
          style:"display:block"
      },
      children:['新增'],
      emit: ['click'],
      emitPrefix: 'btn-add',
    }
  ]  
export const FORM_MATERIAL_CLASSIFY1 = [
    {
      type: "input",
      field: "name",
      title: "一级分类",
      value: "",
      props: { type: "text"},
      validate: [
        { required: true, message: "请输入一级分类", trigger: "blur" }
      ]
    },
    {
        type: "input",
        field: "remarks",
        title: "备注",
        value: "",
        col: { span: 24 },
        props: { type: "textarea"}
      }
  ]

  export const FORM_MATERIAL_CLASSIFY2 = [
    {
      type: "select",
      field: "parentId",
      title: "一级分类",
      value: "",
      options:[],
      props: { style:"width:100%"},
      validate: [
        { required: true, message: "请选择一级分类", trigger: "change" }
      ]
    },
    {
      type: "input",
      field: "name",
      title: "二级分类",
      value: "",
      props: { type: "text" },
      validate: [
        { required: true, message: "请输入二级分类", trigger: "blur" }
      ]
    },
    {
        type: "input",
        field: "remarks",
        title: "备注",
        value: "",
        props: { type: "textarea"}
      }
  ]

  export const FORM_MATERIAL_CLASSIFY3 = [
    {
      type: "select",
      field: "parentIds",
      title: "一级分类",
      value: "",
      options:[],
      props: { style:"width:100%"},
      validate: [
        { required: true, message: "请选择一级分类", trigger: "change" }
      ],
      emit: ['change'],
      emitPrefix: 'btn-type3',
    },
    {
      type: "select",
      field: "parentId",
      title: "二级分类",
      value: "",
      options:[],
      props: { style:"width:100%"},
      validate: [
        { required: true, message: "请选择二级分类", trigger: "change" }
      ]
    },
    {
      type: "input",
      field: "name",
      title: "三级分类",
      value: "",
      props: { type: "text" },
      validate: [
        { required: true, message: "请输入三级分类", trigger: "blur" }
      ]
    },
    {
        type: "input",
        field: "remarks",
        title: "备注",
        value: "",
        col: { span: 24 },
        props: { type: "textarea"}
      }
  ]

  export const MATERIAL_CLASSIFY_LABEL1 = [
    { label: "创建时间", prop: "createTime",width:"150",type:'createTime'},
    { label: "一级分类", prop: "name",width:"150",type:'normal'},
    { label: "备注", prop:'remarks',width:"200",type:'normal'},
    { label: "创建人", prop: "createUserName",width:"150",type:'normal'},
    { label: "更新时间", prop: "updateTime",width:"150",type:'updateTime'}
  ]
  export const MATERIAL_CLASSIFY_LABEL2 = [
    { label: "创建时间", prop: "createTime",width:"150",type:'createTime'},
    { label: "一级分类", prop: "type1Name",width:"150",type:'normal'},
    { label: "二级分类", prop: "name",width:"150",type:'normal'},
    { label: "备注", prop:'remarks',width:"200",type:'normal'},
    { label: "创建人", prop: "createUserName",width:"150",type:'normal'},
    { label: "更新时间", prop: "updateTime",width:"150",type:'updateTime'}
  ]
  export const MATERIAL_CLASSIFY_LABEL3 = [
    { label: "创建时间", prop: "createTime",width:"150",type:'createTime'},
    { label: "一级分类", prop: "type1Name",width:"150",type:'normal'},
    { label: "二级分类", prop: "type2Name",width:"150",type:'normal'},
    { label: "三级分类", prop: "name",width:"150",type:'normal'},
    { label: "备注", prop:'remarks',width:"200",type:'normal'},
    { label: "创建人", prop: "createUserName",width:"150",type:'normal'},
    { label: "更新时间", prop: "updateTime",width:"150",type:'updateTime'}
  ]



  export const OPTION_INLINE = {
    form: { labelWidth: "" ,inline: true,size:"small"},
    resetBtn: false,
    submitBtn: false
  }
  export const OPTION_BLOCK= {
    form: { labelWidth: "" ,size:"small"},
    row:{gutter: 20},
    resetBtn: false,
    submitBtn: false
  }
 



